package Monopol;
import java.util.Random;

import javax.swing.JLabel;

import Utils.Utils;

/**
 * @author Avia Tam
 * @author Assaf Miron
 *
 */
public class Cube {
	Integer value; // The Cube Number Value
	
	/**
	 * This Function Will Generate a Random number between 1-6
	 * Indicating the Cube Result after it is Thrown.
	 * @return the Value of the Cube
	 */
	public Integer throwcube()
	{
		// Create a Random Number Generator
		Random generator = new Random();
		// Get a Random Number between 1-6, Save in Value Parameter
		value = generator.nextInt(6)+1;
		// Return the Random Generated Number
		return value;
	}
	
	public JLabel getCubePanel()
	{
		// Create a new Cube Image Label
		JLabel lblCube = new JLabel(Utils.getImageIcon("/cubes/" + value + "cube.png"), JLabel.CENTER);
		// Return the Image Label
		return lblCube;
	}

}
